<admintpl file="headerEx" />
<title>{:L('ADMIN_BACKUP_RESTORE')}</title>
<link href="__PUBLIC__/js/artDialog/skins/default.css" rel="stylesheet" />
<!--responsive table-->
<link href="__PUBLIC__/TciocEx/css/table-responsive.css" rel="stylesheet" />
</head>

<!-- Placed js at the end of the document so the pages load faster -->
<body class="sticky-header">
<section>
    <!-- main content start-->
    <div class="full-content" >
        <!--body wrapper start-->
        <div class="wrapper">
            <div class="row">
                <div class="col-sm-12">
                    <section class="panel">
                        <header class="panel-heading custom-tab turquoise-tab">
                            <ul class="nav nav-tabs">
                                <li class="active"><a href="{:U('Admin/backup/restore')}"><i class="fa fa-list-ul"></i> {:L('ADMIN_BACKUP_RESTORE')}</a></li>
                            </ul>
                        </header>
                        <php> $status=array("1"=>L('DISPLAY'),"0"=>L('HIDDEN')); </php>
                        <div class="panel-body">
                            <section class="panel" >
                                <form class="form-horizontal js-ajax-form form-horizontal " role="form" method="post" action="{:U('Admin/backup/import')}">

                                    <section id="no-more-tables">
                                        <table class="table table-bordered table-striped table-hover table-condensed cf">
                                            <thead>
                                            <tr>
                                                <th align="left">{:L('NAME')}</th>
                                                <th>{:L('FILE_SIZE')}</th>
                                                <th>{:L('BACKUP_TIME')}</th>
                                                <th>{:L('ACTIONS')}</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <volist name="backups" id="val">
                                                <tr class="collapsed">
                                                    <td>
                                                        <span style="padding-left: 20px" name="{$val.name}" class="expander"></span>
                                                        {$val.name}
                                                    </td>
                                                    <td>{$val.total_size}kb</td>
                                                    <td>{$val.date_str}</td>
                                                    <td>
                                                        <a href="{:U('Admin/backup/del_backup', array('backup'=>$val['name']))}"  class="js-ajax-delete">{:L('DELETE')}</a> |
                                                        <a href="{:U('Admin/backup/import', array('backup'=>$val['name']))}" class="js-ajax-dialog-btn" data-msg="确定恢复吗？">{:L('RESTORE')}</a>
                                                    </td>
                                                </tr>
                                                <volist name="val['vols']" id="vol">
                                                    <tr parent="{$val.name}" class="hide">
                                                        <td>{$vol.file}</td>
                                                        <td>{$vol.size}kb</td>
                                                        <td>{$val.date_str}</td>
                                                        <td>
                                                            <a href="{:U('Admin/backup/download', array('backup'=>$val['name'], 'file'=>$vol['file']))}">{:L('DOWNLOAD')}</a>
                                                        </td>
                                                    </tr>
                                                </volist>
                                            </volist>
                                            </tbody>
                                        </table>
                                    </section>
                                </form>
                            </section>
                        </div>
                    </section>
                </div>
            </div>
        </div>

    </div>
    </div>
    </div>
    <!--body wrapper end-->

    <!--footer section start-->
    <footer>
        <admintpl file="copyright" />
    </footer>
    <!--footer section end-->

    </div>
    <!-- main content end-->
</section>
<script src="__PUBLIC__/TciocEx/js/jquery-1.10.2.min.js"></script>
<script src="__PUBLIC__/js/wind.js"></script>
<script src="__PUBLIC__/js/common.js"></script>
<script src="__PUBLIC__/TciocEx/js/jquery-ui-1.9.2.custom.min.js"></script>
<script src="__PUBLIC__/simpleboot/bootstrap/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/jquery-migrate-1.2.1.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/modernizr.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/jquery.nicescroll.js"></script>
<script src="__PUBLIC__/js/ajaxForm.js"></script>

<script type="text/javascript" src="__PUBLIC__/TciocEx/js/jquery.validate.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/validation-localization/messages_zh.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/scripts.js"></script>
<script src="__PUBLIC__/TciocEx/js/validation-init.js"></script>

<style type="text/css">
    .hide{display:none;}
    .table_list tr.expanded td .expander{
        background: url(__TMPL__Public/assets/images/tv-collapsable.gif) center center no-repeat;
    }
    .table_list tr.collapsed td .expander{
        background: url(__TMPL__Public/assets/images/tv-expandable.gif) center center no-repeat;
    }
</style>
<script>
    $(function(){
        $(".show_sub").click(function(){
            $(this).attr("src",function(){
                if(this.src == '__TMPL__Public/assets/images/tv-expandable.gif'){
                    return '__TMPL__Public/assets/images/tv-collapsable.gif';
                } else {
                    return '__TMPL__Public/assets/images/tv-expandable.gif';
                }
            });
            var sub_id = $(this).attr('sub');
            $("tr[parent='"+sub_id+"']").toggle();
        });
        $('.expander').toggle(function(){
            $(this).parent().parent().removeClass('collapsed').addClass('expanded');
            $('tr[parent="'+$(this).attr('name')+'"]').show();
        },function(){
            $(this).parent().parent().removeClass('expanded').addClass('collapsed');
            $('tr[parent="'+$(this).attr('name')+'"]').hide();
        });
    });
</script>

</body>
</html>